home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1999 May / SGI IRIX 6.5 Applications 1999 May.iso / dist / arraysvcs.idb / usr / include / arraysvcs.h.z / arraysvcs.h
C/C++ Source or Header  |  1998-10-27  |  19KB  |  540 lines

  1. #ifndef __ARRAYSVCS_H__
  2. #define __ARRAYSVCS_H__
  3.  
  4. /*
  5.  * arraysvcs.h
  6.  *
  7.  *    Interfaces for the array services library
  8.  *
  9.  * Copyright 1995, Silicon Graphics, Inc.
  10.  * ALL RIGHTS RESERVED
  11.  *
  12.  * UNPUBLISHED -- Rights reserved under the copyright laws of the United
  13.  * States.   Use of a copyright notice is precautionary only and does not
  14.  * imply publication or disclosure.
  15.  *
  16.  * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
  17.  * Use, duplication or disclosure by the Government is subject to restrictions
  18.  * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
  19.  * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
  20.  * in similar or successor clauses in the FAR, or the DOD or NASA FAR
  21.  * Supplement.  Contractor/manufacturer is Silicon Graphics, Inc.,
  22.  * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
  23.  *
  24.  * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY
  25.  * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION,
  26.  * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY
  27.  * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON
  28.  * GRAPHICS, INC.
  29.  */
  30. /*
  31.  *    (C) COPYRIGHT CRAY RESEARCH, INC.
  32.  *    UNPUBLISHED PROPRIETARY INFORMATION.
  33.  *    ALL RIGHTS RESERVED.
  34.  */
  35.  
  36. #ident "$Revision: 1.48 $"
  37.  
  38. /* USMID %Z%%M%    %I%    %G% %U% */
  39.  
  40. #if defined(_LANGUAGE_C_PLUS_PLUS)
  41. extern "C" {
  42. #endif
  43.  
  44. #include <sys/types.h>
  45. #include <netinet/in.h>
  46.  
  47. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  48.  
  49.  
  50. /*
  51.  * Basic types
  52.  */
  53. typedef uintptr_t    asserver_t;    /* Server token */
  54.  
  55. typedef uint64_t    askey_t;    /* Authentication key */
  56. #define AS_NOKEY    0        /* No key specified */
  57.  
  58. typedef uint16_t    asident_t;    /* Entity identifier */
  59.  
  60.  
  61.  
  62. /*
  63.  * error handling
  64.  *    Most array services store a result code in the global variable
  65.  *    "aserrorcode".  This result code may actually contain several
  66.  *    fields.  A general summary of the error code, similar to the
  67.  *    standard "errno", can be found in "aserrno".
  68.  */
  69.  
  70. /* Error code declarations */
  71. typedef __uint32_t aserror_t;
  72.  
  73. #define aserrnoc(E)    ((E) & 255)
  74. #define aserrwhatc(E)  (((E) >> 8) & 255)
  75. #define aserrwhyc(E)   (((E) >> 16) & 255)
  76. #define aserrextrac(E) ((E) >> 24)
  77.  
  78. extern aserror_t aserrorcode;
  79.  
  80. #define aserrno    (aserrnoc(aserrorcode))
  81. #define aserrwhat  (aserrwhatc(aserrorcode))
  82. #define aserrwhy   (aserrwhyc(aserrorcode))
  83. #define aserrextra (aserrextrac(aserrorcode))
  84.  
  85.  
  86. /* Error summary numbers */
  87. #define ASE_OK        0        /* Operation successful */
  88. #define ASE_SYSERROR    1        /* System operation failed */
  89. #define ASE_BADVALUE    2        /* Invalid value/argument */
  90. #define ASE_REQFAILED    3        /* Request failed */
  91. #define ASE_BADCOMMAND    4        /* Invalid command */
  92. #define ASE_PROTOCOL    5        /* Protocol error */
  93. #define ASE_INTERNAL    6        /* Internal error */
  94. #define ASE_NOARRAYSVCS 7        /* Array services not installed */
  95.  
  96. /* ASE_OK "why" codes ("what" is undefined) */
  97. #define ASOK_COMPLETED    0        /* Command/request completed */
  98. #define ASOK_INITIATED    1        /* Command started, may not be done */
  99. #define ASOK_CONNECT    2        /* Initiate connection */
  100. #define ASOK_CONNECTED    3        /* Connection completed */
  101.  
  102. /* ASE_NOARRAYSVCS has no "what" or "why" code */
  103.  
  104. /* ASE_SYSERROR "what" codes.  ("why" == errno) */
  105. #define ASSE_UNKNOWN    0        /* Origin unknown */
  106. #define ASSE_CMDFORK    1        /* Command process fork */
  107. #define ASSE_REQFORK    2        /* Request process fork */
  108. #define ASSE_WAIT    3        /* Wait for process */
  109. #define ASSE_SELECT    4        /* Wait for event */
  110. #define ASSE_READHDR    5        /* Read message header */
  111. #define ASSE_READBODY    6        /* Read message body */
  112. #define ASSE_WRITEHDR    7        /* Write message header */
  113. #define ASSE_WRITEBODY    8        /* Write message body */
  114. #define ASSE_GETASH    9        /* Extract ASH */
  115. #define ASSE_PIDSINASH    10        /* Extract PIDs in ASH */
  116. #define ASSE_ACCEPT    11        /* Accept client connection */
  117. #define ASSE_SOCKET    12        /* Create socket */
  118. #define ASSE_CONNECT    13        /* Connect to server */
  119. #define ASSE_SETSOCKOPT 14        /* Set socket options */
  120. #define ASSE_BIND    15        /* Bind name to socket */
  121. #define ASSE_LISTEN    16        /* Listen for connections */
  122. #define ASSE_WRITEOUT    17        /* Write output data */
  123. #define ASSE_OPENPROCD    18        /* Open procfs directory */
  124. #define ASSE_OPENOUT    19        /* Open output file */
  125. #define ASSE_STATOUT    20        /* Stat output file */
  126. #define ASSE_READOUT    21        /* Read output file */
  127. #define ASSE_ENUMASHS    22        /* Enumerate ASHs */
  128. #define ASSE_PEERNAME    23        /* Get peer name */
  129. #define ASSE_SOCKNAME    24        /* Get socket name */
  130. #define ASSE_STATUDS    25        /* Stat unix domain socket */
  131. #define ASSE_IOCTLNBIO    26        /* Make socket non-blocking */
  132. #define ASSE_GETSRVOPT  27        /* Get server option */
  133. #define ASSE_KILL    28        /* Send signal to process */
  134. #define ASSE_SETUID    29        /* Set user ID */
  135. #define ASSE_UNAME    30        /* Get OS information */
  136. #define ASSE_GETSPINFO    31        /* Get Service Provider Info */
  137. #define ASSE_ARSOP    32        /* Array Session Operation */
  138. #define ASSE_GETPRIO    33        /* Get scheduling priority */
  139. #define ASSE_GETRLIM    34        /* Get resource limit */
  140. #define ASSE_CHMOD    35        /* Change file permissions */
  141. #define ASSE_MONFORK    36        /* Monitor process fork */
  142.  
  143. /* ASE_BADVALUE "what" codes */
  144. #define ASBV_UNKNOWN    0        /* Unknown value */
  145. #define ASBV_PORTNUM    1        /* Port number */
  146. #define ASBV_ARRAY    2        /* Array name */
  147. #define ASBV_HOST    3        /* Host name */
  148. #define ASBV_SRVTOKEN    4        /* Server token */
  149. #define ASBV_OPTNAME    5        /* Option name */
  150. #define ASBV_OPTVAL    6        /* Option value */
  151. #define ASBV_PID    7        /* Process ID */
  152. #define ASBV_DEST       8        /* Destination */
  153. #define ASBV_CONNECT    9        /* Connection info */
  154. #define ASBV_ADDRFAMILY 10        /* Address family */
  155. #define ASBV_OPTINFO    11        /* Options information */
  156. #define ASBV_ARGS    12        /* Command line arguments */
  157. #define ASBV_TARGET    13        /* Target of signal */
  158.  
  159. /* ASE_BADVALUE "why" codes */
  160. #define ASBVY_UNKNOWN    0        /* Do not know why */
  161. #define ASBVY_RANGE    1        /* Value out of range */
  162. #define ASBVY_PARSE    2        /* Cannot parse value */
  163. #define ASBVY_NOTFOUND    3        /* Value not found */
  164. #define ASBVY_SIZE    4        /* Size of value is invalid */
  165. #define ASBVY_INVALID    5        /* Value generally invalid */
  166. #define ASBVY_NODEFAULT 6        /* No default for unspecified value */
  167.  
  168. /* ASE_REQFAILED "why" codes  ("what" is undefined) */
  169. #define ASRFY_UNKNOWN    0        /* Do not know why */
  170. #define ASRFY_VERSION    1        /* Wrong version of arrayd */
  171. #define ASRFY_TIMEOUT    2        /* Timed out waiting for command */
  172. #define ASRFY_BADOS    3        /* Wrong version of IRIX */
  173. #define ASRFY_NOCONNECT    4        /* Unable to connect interactively */
  174. #define ASRFY_BADCLIENT 5        /* Client connection invalid */
  175. #define ASRFY_CONNECTTO 6        /* Interactive connection timed out */
  176. #define ASRFY_BADAUTH    7        /* Authentication error */
  177.  
  178. /* ASE_BADCOMMAND "why" codes ("what" is undefined) */
  179. #define ASBCY_UNKNOWN    0        /* Do not know why */
  180. #define ASBCY_NOTFOUND    1        /* Command not found */
  181. #define ASBCY_EMPTY    2        /* Nothing to INVOKE */
  182. #define ASBCY_BADUSER    3        /* Invalid USER */
  183. #define ASBCY_BADGROUP    4        /* Invalid GROUP */
  184. #define ASBCY_BADPROJ    5        /* Invalid PROJECT */
  185. #define ASBCY_ILLMERGE  6        /* MERGE illegal for request */
  186. #define ASBCY_NOINFO    7        /* No command info provided */
  187.  
  188. /* Error functions */
  189. aserror_t asmakeerror(int, int, int, int);
  190. void asperror(const char *, ...);
  191. const char *asstrerror(aserror_t);
  192. int asperrlog(asserver_t, ash_t ASH, const char *, ...);
  193. int aserrlogstat(asserver_t, ash_t);
  194.  
  195.  
  196. /* Destination flags */
  197. #define ASDST_NONE   0            /* Destination not specified */
  198. #define ASDST_LOCAL  1            /* Local machine only */
  199. #define ASDST_SERVER 2            /* Specified server only */
  200. #define ASDST_ARRAY  3            /* Specified array */
  201.  
  202.  
  203. /*
  204.  * Server functions
  205.  *    Most array commands take an optional "asserver_t" argument to
  206.  *    specify an array server other than the default. These functions
  207.  *    create/destroy these tokens and modify options associated with them.
  208.  */
  209. asserver_t asopenserver(const char *, int);
  210. void       ascloseserver(asserver_t);
  211.  
  212. int asdfltserveropt(int, void *, int *);
  213. int asgetserveropt(asserver_t, int, void *, int *);
  214. int assetserveropt(asserver_t, int, const void *, int);
  215.  
  216. /* Server option names */
  217. #define AS_SO_TIMEOUT    1    /* Response timeout value */
  218. #define AS_SO_CTIMEOUT    2    /* Connection timeout value */
  219. #define AS_SO_FORWARD    3    /* Forwarding on/off */
  220. #define AS_SO_LOCALKEY  4    /* Local authentication key */
  221. #define AS_SO_REMOTEKEY 5    /* Remote authentication key */
  222. #define AS_SO_PORTNUM    6    /* Port number (dflt only) */
  223. #define AS_SO_HOSTNAME    7    /* Host name (dflt only) */
  224.  
  225.  
  226. /*
  227.  * ASH functions
  228.  */
  229. ash_t asallocash(asserver_t, const char *);
  230. int   asashisglobal(ash_t);
  231. ash_t asashofpid(pid_t);
  232.  
  233. typedef struct aspidlist {
  234.     int    numpids;    /* Number of PIDs in list */
  235.     pid_t   *pids;        /* Array of PIDs */
  236. } aspidlist_t;
  237.  
  238. typedef struct asmachinepidlist {
  239.     int       numpids;    /* Number of PIDs in list */
  240.     pid_t       *pids;    /* Array of PIDs */
  241.     const char *machname;    /* Name of machine */
  242.     char       rsrvd[44];    /* reserved for expansion */
  243. } asmachinepidlist_t;
  244.  
  245. typedef struct asarraypidlist {
  246.     int        nummachines;    /* Number of machines in list */
  247.     asmachinepidlist_t **machines;    /* List of asmachpidlist_t's */
  248.     const char    *arrayname;    /* Name of array */
  249.     char        rsrvd[44];    /* reserved for expansion */
  250. } asarraypidlist_t;
  251.  
  252. aspidlist_t *aspidsinash(ash_t);
  253. aspidlist_t *aspidsinash_local(ash_t);
  254. asmachinepidlist_t *aspidsinash_server(asserver_t, ash_t);
  255. asarraypidlist_t *aspidsinash_array(asserver_t, const char *, ash_t);
  256.  
  257.  
  258. /*
  259.  * Array command functions
  260.  */
  261. typedef struct ascmdreq {
  262.     char     *array;    /* Name of target array */
  263.     uint32_t flags;        /* Option flags */
  264.     int     numargs;    /* Number of arguments */
  265.     char     **args;    /* Cmd arguments (ala argv) */
  266.     uint32_t ioflags;    /* I/O flags for interactive commands */
  267.  
  268.     char     rsrvd[100];    /* reserved for expansion: init to 0's */
  269. } ascmdreq_t;
  270.  
  271. #define ASCMDREQ_LOCAL        0x80000000    /* Do not broadcast to array */
  272. #define ASCMDREQ_NEWSESS    0x40000000    /* Start new array session */
  273. #define ASCMDREQ_OUTPUT        0x20000000    /* Collect output from cmd */
  274. #define ASCMDREQ_NOWAIT        0x10000000    /* Do not wait on command */
  275. #define ASCMDREQ_INTERACTIVE    0x08000000    /* Run interactively */ 
  276.  
  277. #define ASCMDIO_STDIN        0x80000000    /* Provide stdin to command */
  278. #define ASCMDIO_STDOUT        0x40000000    /* Provide stdout to command */
  279. #define ASCMDIO_STDERR        0x20000000    /* Provide stderr to command */
  280. #define ASCMDIO_SIGNAL        0x10000000    /* Send signals to command */
  281. #define ASCMDIO_OUTERRSHR    0x08000000    /* Provide stderr via stdout */
  282. #define ASCMDIO_ERRLOG        0x04000000    /* Log stderr to a logfile.
  283.                          * ASCMDIO_STDERR, 
  284.                          * ASCMDIO_FULLIO or  
  285.                          * ASCMDIO_OUTERRSHR will
  286.                          * override this flag 
  287.                          */
  288.  
  289. #define ASCMDIO_FULLIO        (ASCMDIO_STDIN  | \
  290.                  ASCMDIO_STDOUT | \
  291.                  ASCMDIO_STDERR | \
  292.                  ASCMDIO_SIGNAL)    /* Provide full I/O */
  293.  
  294.  
  295. typedef struct ascmdrslt {
  296.     char      *machine;    /* Name of responding machine */
  297.     ash_t      ash;        /* ASH of running command */
  298.     uint32_t  flags;    /* Result flags */
  299.     aserror_t error;    /* Error code for this command */
  300.     int      status;    /* Exit status */
  301.     char      *outfile;    /* Name of output file */
  302.  
  303.     uint32_t  ioflags;    /* I/O connections (see ascmdreq_t) */
  304.     int      stdinfd;    /* File descriptor for command's stdin */
  305.     int      stdoutfd;    /* File descriptor for command's stdout */
  306.     int      stderrfd;    /* File descriptor for command's stderr */
  307.     int      signalfd;    /* File descriptor for sending signals */
  308.  
  309.     /* stay tuned for future expansion */
  310. } ascmdrslt_t;
  311.  
  312. #define ASCMDRSLT_OUTPUT    0x80000000    /* Output available */
  313. #define ASCMDRSLT_MERGED    0x40000000    /* Output is merged */
  314. #define ASCMDRSLT_ASH        0x20000000    /* ASH is available */
  315. #define ASCMDRSLT_INTERACTIVE    0x10000000    /* I/O connections available */
  316.  
  317.  
  318. typedef struct ascmdrsltlist {
  319.     int    numresults;    /* Number of ascmdrslt_t's */
  320.     ascmdrslt_t **results;    /* Array of ascmdrslt_t pointers */
  321. } ascmdrsltlist_t;
  322.  
  323.  
  324. ascmdrsltlist_t *ascommand(asserver_t, const ascmdreq_t *);
  325.  
  326.  
  327. /*
  328.  * Remote execution functions
  329.  */
  330. int asrcmd(asserver_t, char *, char *, int *);
  331. int asrcmdv(asserver_t, char *, char **, int *);
  332.  
  333.  
  334.  
  335. /*
  336.  * aslist<> functions
  337.  *    These functions return a malloc'ed list of items of the specified
  338.  *    type containing configuration or status information. The corresponding
  339.  *    "asfree<>" functions may be used to release the storage allocated by
  340.  *    the "aslist<>" functions.
  341.  */
  342. typedef struct asarray {
  343.     const char *name;        /* Name of array */
  344.     int       numattrs;        /* Number of attribute strings */
  345.     const char **attrs;        /* List of attribute strings */
  346.     u_short       ident;        /* Array ID */
  347. } asarray_t;
  348.  
  349. typedef struct asarraylist {
  350.     int      numarrays;        /* Number of arrays in list */
  351.     asarray_t **arrays;        /* Array of asarray_t pointers */
  352. } asarraylist_t;
  353.  
  354. asarray_t *asgetdfltarray(asserver_t);
  355. asarraylist_t *aslistarrays(asserver_t);
  356.  
  357.  
  358. typedef struct asashlist {
  359.     int    numashs;        /* Number of ASHs in list */
  360.     ash_t   *ashs;            /* Array of ASHs */
  361. } asashlist_t;
  362.  
  363. asashlist_t *aslistashs(asserver_t, const char *, int Dest, uint32_t Flags);
  364. asashlist_t *aslistashs_array(asserver_t, const char *);
  365. asashlist_t *aslistashs_local(void);
  366. asashlist_t *aslistashs_server(asserver_t);
  367.  
  368. /* Control flags for aslistashs */
  369. #define ASLAF_NOLOCAL    0x00000001    /* Global ASHs only */
  370. #define ASLAF_NODUPS    0x00000002    /* Remove duplicate ASHs */
  371. #define ASLAF_NODUPES    0x00000002    /* (for compatibility) */
  372.  
  373.  
  374. typedef struct asmachine {
  375.     const char     *name;        /* Familiar name of machine */
  376.     const char     *hostname;    /* Network hostname of machine */
  377.     int           numattrs;    /* Number of attribute strings */
  378.     const char     **attrs;        /* List of attribute strings */
  379.     struct in_addr inaddr;        /* IP address of machine */
  380.     u_short           portnum;        /* Port # of array daemon */
  381.     asident_t      ident;        /* ID of array daemon */
  382. } asmachine_t;
  383.  
  384. typedef struct asmachinelist {
  385.     int    nummachines;        /* Number of machines in list */
  386.     asmachine_t **machines;        /* Array of asmachine_t pointers */
  387. } asmachinelist_t;
  388.  
  389. asmachinelist_t *aslistmachines(asserver_t, const char *ArrayName);
  390.  
  391.  
  392. /*
  393.  * asfree<> functions
  394.  *    These functions are used to release the storage allocated by other
  395.  *    libarray functions (e.g. the aslist<> functions)
  396.  */
  397. void asfreearray(asarray_t *, uint32_t);
  398. void asfreearraylist(asarraylist_t *, uint32_t);
  399. void asfreearraypidlist(asarraypidlist_t *, uint32_t);
  400. void asfreeashlist(asashlist_t *, uint32_t);
  401. void asfreecmdrslt(ascmdrslt_t *, uint32_t);
  402. void asfreecmdrsltlist(ascmdrsltlist_t *, uint32_t);
  403. void asfreemachine(asmachine_t *, uint32_t);
  404. void asfreemachinelist(asmachinelist_t *, uint32_t);
  405. void asfreemachinepidlist(asmachinepidlist_t *, uint32_t);
  406. void asfreepidlist(aspidlist_t *, uint32_t);
  407.  
  408. #define ASFLF_FREEDATA    0x80000000    /* Free individual list items */
  409. #define ASFLF_UNLINK    0x40000000    /* Unlink temporary files */
  410. #define ASFLF_CLOSEIO    0x20000000    /* Close I/O connections */
  411. #define ASFLF_CLOSESRV    0x10000000    /* Close server token */
  412.  
  413.  
  414. /*
  415.  * Option parsing functions
  416.  *    Used by array services clients to provide a standard set of
  417.  *    command line options.
  418.  */
  419. typedef struct asoptinfo {
  420.     int    argc;        /* Number of unparsed arguments */
  421.     char    **argv;        /* Array of ptrs to unparsed arguments */
  422.  
  423.     int    valid;        /* Bitmap of valid fields */
  424.     int    invalid;    /* Bitmap of fields with invalid arguments */
  425.     int    options;    /* Option flags */
  426.  
  427.     asserver_t token;    /* Token for specified server */
  428.  
  429.     char    *server;    /* ASCII name of target server */
  430.     char    *array;        /* Name of array to operate on */
  431.     askey_t    localkey;    /* Local authentication key */
  432.     askey_t remotekey;    /* Remote authentication key */
  433.     ash_t    ash;        /* ASH to operate on */
  434.     pid_t    pid;        /* PID to operate on */
  435.     int    portnum;    /* Port number of arrayd */
  436.     int    timeout;    /* Response timeout in seconds */
  437.     int    connectto;    /* Connect timeout in seconds */
  438.     int    verbose;    /* Verbose level */
  439. } asoptinfo_t;
  440.  
  441. /* Select/Valid flags */
  442. #define ASOIV_TOKEN    0x00000001    /* Server token */
  443. #define ASOIV_SERVER    0x00000002    /* Server name */
  444. #define ASOIV_ARRAY    0x00000004    /* Array name */
  445. #define ASOIV_LCLKEY    0x00000008    /* Local authentication key */
  446. #define ASOIV_REMKEY    0x00000010    /* Remote authentication key */
  447. #define ASOIV_ASH    0x00000020    /* Array session handle */
  448. #define ASOIV_PID    0x00000040    /* Process ID */
  449. #define ASOIV_PORTNUM    0x00000080    /* Port number */
  450. #define ASOIV_TIMEOUT    0x00000100    /* Timeout */
  451. #define ASOIV_CONNECTTO 0x00000200    /* Connect timeout */
  452. #define ASOIV_VERBOSE    0x00000400    /* Verbose level */
  453. #define ASOIV_FORWARD    0x00000800    /* Forwarding mode */
  454. #define ASOIV_LOCAL    0x00001000    /* Local mode */
  455.  
  456. #define ASOIV_STD    (ASOIV_SERVER | ASOIV_ARRAY | ASOIV_LCLKEY | \
  457.              ASOIV_REMKEY | ASOIV_PORTNUM | ASOIV_TIMEOUT | \
  458.              ASOIV_CONNECTTO | ASOIV_FORWARD)
  459.  
  460. /* Option flags */
  461. #define ASOIO_LOCAL    0x00000001    /* Local machine only */
  462. #define ASOIO_FORWARD    0x00000002    /* Forward request via local server */
  463.  
  464. /* Control flags */
  465. #define ASOIC_LOGERRS    0x00000001    /* Print error messages */
  466. #define ASOIC_NODUPS    0x00000002    /* Do not allow redundant args */
  467. #define ASOIC_OPTSONLY    0x00000004    /* Stop at first non-option arg */
  468. #define ASOIC_SELONLY    0x00000008    /* Stop at first unselected arg */
  469.  
  470. void asfreeoptinfo(asoptinfo_t *, uint32_t);
  471. asserver_t  asopenserver_from_optinfo(const asoptinfo_t *);
  472. asoptinfo_t *asparseopts(int argc, char **argv, int select, int control);
  473.  
  474.  
  475. /* Signal functions */
  476. int askillpid_server(asserver_t, pid_t, int signum);
  477.  
  478. int askillash_array(asserver_t, const char *array, ash_t, int signum);
  479. int askillash_local(ash_t, int signum);
  480. int askillash_server(asserver_t, ash_t, int signum);
  481.  
  482. /* Signal functions - with Ignore PID feature */
  483. int askillash_array_ign(asserver_t, const char *array, ash_t,
  484.                 int signum, aspidlist_t *);
  485. int askillash_local_ign(ash_t, int signum, aspidlist_t *);
  486. int askillash_server_ign(asserver_t, ash_t, int signum, aspidlist_t *);
  487.  
  488.  
  489. /*
  490.  * Constants pertaining to ASH's and PRID's
  491.  */
  492. #ifndef lint
  493. #  ifndef CRAY
  494. #define ASBADASH    -1LL    /* An invalid Array Session Handle */
  495. #define ASMINASH    0LL    /* Smallest valid Array Session Handle */
  496. #define ASNOASH        0LL    /* "No ASH specified" */
  497. #define ASASHMASK    0x7FFFFFFFFFFFFFFFLL    /* Valid ASH bits */
  498.  
  499. #define ASBADPRID    -1LL    /* An invalid project ID */
  500. #define ASMINPRID    0LL    /* Smallest valid project ID */
  501. #define ASNOPRID    0LL    /* "No project ID specified" */
  502. #  else
  503. /*
  504.  * CRAY doesn't have a long long type - longs are 64 bits though
  505.  */
  506. #define ASBADASH    -1L    /* An invalid Array Session Handle */
  507. #define ASMINASH    0L    /* Smallest valid Array Session Handle */
  508. #define ASNOASH        0L    /* "No ASH specified" */
  509. #define ASASHMASK    0x7FFFFFFFFFFFFFFFL    /* Valid ASH bits */
  510.  
  511. #define ASBADPRID    -1L    /* An invalid project ID */
  512. #define ASMINPRID    0L    /* Smallest valid project ID */
  513. #define ASNOPRID    0L    /* "No project ID specified" */
  514. #  endif
  515.  
  516. #else
  517. /* Bogus values that don't use lint-unfriendly "LL" */
  518. #define ASBADASH    -1
  519. #define ASMINASH    0
  520. #define ASNOASH        0
  521. #define ASASHMASK    0x7FFFFFFF
  522. #define ASBADPRID    -1
  523. #define ASMINPRID    0
  524. #define ASNOPRID    0
  525. #endif
  526.  
  527.  
  528. /*
  529.  * Miscellaneous functions
  530.  */
  531. const char *asgetattr(const char *, const char **, int);
  532.  
  533. #endif /* C || C++ */
  534.  
  535. #if defined(_LANGUAGE_C_PLUS_PLUS)
  536. }
  537. #endif
  538.  
  539. #endif  /* !__ARRAYSVCS_H_ */
  540.